package com.xcity.pomelo.response;

import static com.xcity.game.combat.attr.CombatAttributeType.ATTACK_POWER;
import static com.xcity.game.combat.attr.CombatAttributeType.ATTACK_SPEED;
import static com.xcity.game.combat.attr.CombatAttributeType.AVOID_CRIT;
import static com.xcity.game.combat.attr.CombatAttributeType.CRIT;
import static com.xcity.game.combat.attr.CombatAttributeType.CRIT_DAMAGE;
import static com.xcity.game.combat.attr.CombatAttributeType.DEFENSE;
import static com.xcity.game.combat.attr.CombatAttributeType.DODGE;
import static com.xcity.game.combat.attr.CombatAttributeType.HIT_RATE;
import static com.xcity.game.combat.attr.CombatAttributeType.HP;
import static com.xcity.game.combat.attr.CombatAttributeType.MAGIC_DEFENSE;
import static com.xcity.game.combat.attr.CombatAttributeType.MAGIC_HIT_RATE;
import static com.xcity.game.combat.attr.CombatAttributeType.MAGIC_POWER;
import static com.xcity.game.combat.attr.CombatAttributeType.MAX_HP;
import static com.xcity.game.combat.attr.CombatAttributeType.MAX_MP;
import static com.xcity.game.combat.attr.CombatAttributeType.MP;
import static com.xcity.game.combat.attr.CombatAttributeType.RESIST;

import com.xcity.game.combat.unit.Combatable;

public class CombatAttributeResponse {

	// 一级属性
//	@Deprecated
//	public int STR, INT, AGI, SPI, STA;

	// 二级属性
	public Object attackPower;
	public Object magicPower;
	public Object defense;
	public Object magicDefense;
	public Object crit;
	public Object avoidCrit;
	public Object attackSpeed;
	@Deprecated
	public Object critDamage;
	public Object dodge;
	public Object resist;
	public Object hitRate;
	public Object magicHitRate;
	public Object hp;
	public Object maxHp;
	public Object mp;
	public Object maxMp;
	
	public CombatAttributeResponse() {}
	
	public CombatAttributeResponse(Combatable combatable) {
//		this.STR = (int) combatable.getSTR();
//		this.INT = (int) combatable.getINT();
//		this.AGI = (int) combatable.getAGI();
//		this.SPI = (int) combatable.getSPI();
//		this.STA = (int) combatable.getSTA();
		
		this.attackPower = ATTACK_POWER.format(combatable.getAttackPower());
		this.magicPower = MAGIC_POWER.format(combatable.getMagicPower());
		this.defense = DEFENSE.format(combatable.getDefense());
		this.magicDefense = MAGIC_DEFENSE.format(combatable.getMagicDefense());
		this.crit = CRIT.format(combatable.getCrit());
		this.avoidCrit = AVOID_CRIT.format(combatable.getAvoidCrit());
		this.attackSpeed = ATTACK_SPEED.format(combatable.getAttackSpeed());
		this.critDamage = CRIT_DAMAGE.format(combatable.getCritDamage());
		this.dodge = DODGE.format(combatable.getDodge());
		this.resist = RESIST.format(combatable.getResist());
		this.hitRate = HIT_RATE.format(combatable.getHitRate());
		this.magicHitRate = MAGIC_HIT_RATE.format(combatable.getMagicHitRate());
		this.hp = HP.format(combatable.getHp());
		this.maxHp = MAX_HP.format(combatable.getMaxHp());
		this.mp = MP.format(combatable.getMp());
		this.maxMp = MAX_MP.format(combatable.getMaxMp());
	}
	
}
